<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>编辑</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form form form-horizontal" id="form-sevenVideo-edit" action="#"
              th:action="@{/admin/sevenVideo/edit}" th:object="${sevenVideo}" enctype="multipart/form-data">
            <input type="hidden" name="id" th:value="${sevenVideo.id}"/>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>视频标题：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.title}" name="title"  placeholder="修改视频标题" id="title"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>视频存储地址：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.videoUrl}" name="videoUrl"  placeholder="修改视频存储地址" id="videoUrl"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>状态：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.statusCode}" name="statusCode"  placeholder="修改状态" id="statusCode"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>最后操作人：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.lastOperator}" name="lastOperator"  placeholder="修改最后操作人" id="lastOperator"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>最后状态：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.isPass}" name="isPass"  placeholder="修改最后状态" id="isPass"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>提交人id：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.userId}" name="userId"  placeholder="修改提交人id" id="userId"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>提交时间：</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input timeSpace" readonly="readonly" autocomplete="off" th:value="${#temporals.format(sevenVideo.submitTime, 'yyyy-MM-dd HH:mm:ss')}" name="submitTime" placeholder="请选择提交时间"/>
                </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>是否删除：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.isDelete}" name="isDelete"  placeholder="修改是否删除" id="isDelete"/>

                        </div>
                        </div>
                        </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span
                            class="c-red">*</span>文件名：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" th:value="${sevenVideo.fileName}" name="fileName"  placeholder="修改文件名" id="fileName"/>

                        </div>
                        </div>
                        </div>

                        <div class="layui-form-item">
                        <label class="layui-form-label">
                        </label>
                        <button  class="layui-btn" id="subbtn" type="submit" >
                        增加
                        </button>
                        <button  class="layui-btn" id="reset" type="reset" >
                        重置
                        </button>
                        </div>
                        </form>
                        </div>
                        </div>
<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs"></div>
<div th:replace="_ueditor :: ueditor"></div>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script>
    layui.use(['form', 'layer','laydate'],function() {
        $ = layui.jquery;
        var form = layui.form,
            laydate = layui.laydate,
            layer = layui.layer;
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type: 'datetime'
            });
        });
    });
    $(function () {
        $("#form-sevenVideo-edit").validate({
            rules: {
        title:
        {
            required: true,
        },
        videoUrl:
        {
            required: true,
        },
        statusCode:
        {
            required: true,
        },
        lastOperator:
        {
            required: true,
        },
        isPass:
        {
            required: true,
        },
        userId:
        {
            required: true,
        },
        submitTime:
        {
            required: true,
        },
        isDelete:
        {
            required: true,
        },
        fileName:
        {
            required: true,
        },
    },
        onkeyup:false,
            debug
    :
        true,
            success
    :
        "valid",
            submitHandler
    :

        function (form) {
            $(form).ajaxSubmit({
                type: 'POST',
                url: "/admin/sevenVideo/edit",
                success: function (data) {
                    if (data.code == "1") {
                        selfmsg('编辑成功!', 1, function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.location.reload();
                            parent.layer.close(index);
                        });
                    } else {
                        selfmsg('编辑失败!');
                    }
                },
                error: function () {
                    selfmsg('编辑异常!', 5);
                }
            });
        }
    })
        ;
    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>